#ifndef SOLUTION_H_
#define SOLUTION_H_
class Solution
{
public:
    int reverse(int x) 
	{
        // Start typing your C/C++ solution below
        // DO NOT write int main() function
		typedef unsigned int uint;

		uint abx = x>=0?x:(~x + 1);

		if(abx<10)
			return x;

		uint result = 0;
		while(abx>0)
		{
			result *= 10;
			result += abx%10;
			abx /=10;
		}      

		return x>0?result:(-1*result);
    }
};
#endif
